<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>配送方式编辑</title>
<link href="<%=basePath%>skin/css/validform/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/validform/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/editor/kindeditor.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/common.js"></script>
<script language="javascript">
	$().ready(function(){
		//验证
		var validform = $("#form1").Validform({
			btnSubmit:"#save",
			tiptype:3,
			datatype:{
				"decimal":function(gets,obj,curform,regxp){
					var decimalReg=/^\d{0,8}\.{0,1}(\d{1,2})?$/;
					if(gets == null || gets == ""){
						return "请填写信息";
					}
					if(decimalReg.test(gets)){
						return true;
					}
					return "请填写数字或小数";
				}
			}
		});
		validform.addRule([
			{
			    ele:"#name",
			    datatype:"*",
			    nullmsg:"请输入名称！"
			},
			{
			    ele:"#firstWeight",
			    datatype:"decimal",
			    nullmsg:"请输入首重量！"
			},
			{
			    ele:"#continueWeight",
			    datatype:"decimal",
			    nullmsg:"请输入续重量！"
			},
			{
			    ele:"#firstPrice",
			    datatype:"decimal",
			    nullmsg:"请输入首重价格！"
			},
			{
			    ele:"#continuePrice",
			    datatype:"decimal",
			    nullmsg:"请输入续重价格！"
			},
			{
			    ele:"#orders",
			    datatype:"n",
			    nullmsg:"请输入排序！"
			}
		]);
	 });
</script>
</head>

<body>
	<form id="form1" name="form1" method="post" action="<%=basePath%>admin/shippingMethod/update.shtml">
	<input type="hidden" name="id" value="${shippingMethod.id}"/>
		<table width="98%" class="input tabContent">
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">名称：</td>
				<td class="tdLeft"><input id="name" name="name"
					size="30" class="input" value="${shippingMethod.name }"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">首重量：</td>
				<td class="tdLeft"><input id="firstWeight" name="firstWeight"
					size="30" class="input" value="${shippingMethod.firstWeight }"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">续重量：</td>
				<td class="tdLeft"><input id="continueWeight" name="continueWeight"
					size="30" class="input" value="${shippingMethod.continueWeight }"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">首重价格：</td>
				<td class="tdLeft"><input id="firstPrice" name="firstPrice"
					size="30" class="input" value="<fmt:formatNumber value="${shippingMethod.firstPrice }" pattern="0.00"/>"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">续重价格：</td>
				<td class="tdLeft"><input id="continuePrice" name="continuePrice"
					size="30" class="input" value="<fmt:formatNumber value="${shippingMethod.continuePrice }" pattern="0.00"/>"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">排序：</td>
				<td class="tdLeft"><input id="orders" name="orders"
					size="30" class="input" value="${shippingMethod.orders }"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">介绍：</td>
				<td class="tdLeft">
					<textarea id="editor" name="description" class="editor" style="width: 100%;">${shippingMethod.description }</textarea>
				</td>
			</tr>
		</table>
		<table width="98%">
			<tr bgcolor="#EEF4EA">
				<td height="36" colspan="10">
					<input type="button" value="确定" class="button" id="save" />
					<input type="button" value="返回" class="button" onclick="location.href='<%=basePath%>admin/shippingMethod/list.shtml'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
